<?php
require 'Home/Controller/Controller.php ';
//require 'Admin/Model/UserModel.php';
require 'Home/Model/IndexModel.php';
class IndexController extends Controller{
	function __Construct(){
		parent::__Construct();
		$this->model = new IndexModel();

	}


function reg()
{
	
	$re=$this->model->reg();
	var_dump($re);
	if ($re) {
		 redirect('index.php', '登录成功！欢迎访问，请点击！');	
	}
	else
	{
		redirect('index.php', '登录失败！请点击！');
	}
}








	function index(){
		$getList = $this->model->getList();
		//var_dump($getList);
		$getCartoonType = $this->model->getCartoonType();
		$getCartoonByHint = $this->model->getCartoonByHint();
		//$getVideoByDowntimes = $this->model->getVideoByDowntimes();
		//var_dump($data2);
	/*	$this->assign('list',$data1);
		$this->display(); 
		$this->assign('list',$data2);
		$this->display(); 
		$this->assign('list',$data3);
		$this->display(); 
		$this->assign('list',$data4);
		$this->display(); */
		include 'Home/View/Index/index.php';
	}
	function Login()
	{

$result=$this->model->login();

//$redirect=$this->model->redirect($url, $msg);
if($result){
   /* $_SESSION['user'] = $result;
	  
	  $redirect('index.php?c=index&m=index', '登录成功!');*/
	
	   redirect('admin.php?c=User&m=index', '登录成功！');	
	  	
  }else{
	 /* $redirect('index.php?c=index&m=index', '用户名或密码错误！请重新登录！');	  
	   */
	  redirect('index.php?c=index&m=index', '登录失败！');
	 	 
  } 
	}
	function register()
	{
		$data=$_POST;
		$result=$this->model->adds($data);
//$redirect=$this->model->redirect($url, $msg);
       if($result){
   /* $_SESSION['user'] = $result;
	  
	  $redirect('index.php?c=index&m=index', '登录成功!');*/
	  redirect('index.php?c=index&m=index', '注册成功！');
	  
	  	
  }else{
	 /* $redirect('index.php?c=index&m=index', '用户名或密码错误！请重新登录！');	  
	   */ redirect('index.php?c=index&m=index', '败了！');
	 	  
  } 
	}
	
}
?>